package day6;

import java.util.LinkedList;

public
class TestStack<S> {
    private LinkedList<S> list=new LinkedList();
    //入栈
    public void  set(S s){
        list.addLast(s);
    }
    public S get(){
        return list.removeLast();
    }
    public boolean isEmpty(){
        return list.isEmpty();
    }

}
class TestStack1{
    public static
    void main(String[] args) {
        TestStack<String> stack=new TestStack<>();
        stack.set("java");
        stack.set("php");
        stack.set("python");
        while (!stack.isEmpty()){
            System.out.println(stack.get());
        }
    }
}